using System.Reflection;

using TrueCode.DependencyManager.BuildActions.Injection;


namespace TrueCode.DependencyManager.Services.Parameters
{
  public class AutoParameterProvider : IParameterProvider
  {
    public object[] GetValuesFor( IBuildSession context, ParameterInfo[] parameterInfo )
    {
      var values = new object[parameterInfo.Length];
      for( int i = 0; i < values.Length; i++ )
        values[ i ] = context.MakeCopy( parameterInfo[ i ].ParameterType ).Build();

      return values;
    }
  }
}